<template>
    <div class="top">
        <router-link to="/">千锋课堂</router-link>
        <div>
            <span>欢迎,{{$store.state.user.nickname}}</span>
            <span @click="out">切换账号</span>
        </div>
    </div>
</template>

<script>
    export default {
        methods: {
            out(){
                this.$store.commit("DEL_USER_ID")
                this.$router.push("/login")
            }
        },
    }
</script>

<style scoped lang="scss">
    .top{
        height:8vh;
        color:#fff;
        line-height: 8vh;
        display: flex;
        justify-content: space-between;
        span{
            margin-left:20px;
        }
        span:nth-of-type(2){
            cursor: pointer;
        }
    }
    a{
        color:#fff;
        font-size:30px;
        letter-spacing: 2px;
    }
        

    
</style>